import request from '@/utils/request'

// 成绩管理列表
export const systemScoreManageList = (query) => {
    return request({
        url: '/system/score/manage/list',
        method: 'get',
        params: query
    })
}

// 考试管理列表考题名称
export const systemScoreManageQuestionName = (query) => {
    return request({
        url: '/system/score/manage/questionName',
        method: 'get',
        params: query
    })
}

// 考试管理列表考题名称
export const scoreProgress = (query) => {
    return request({
        url: '/score/progress/get',
        method: 'get',
        params: query
    })
}

// 成绩统计
export const systemScoreManageStatistics = (query) => {
    return request({
        url: '/system/score/manage/statistics',
        method: 'get',
        params: query
    })
}

// 考试成绩发布/取消发布
export const systemScoreManageScorePublish = (query) => {
    return request({
        url: '/system/score/manage/scorePublish',
        method: 'post',
        data: query
    })
}

// 违纪操作
export const systemScoreManageDisciplinary = (query) => {
    return request({
        url: '/system/score/manage/disciplinary',
        method: 'post',
        data: query
    })
}

// 批量分数修改(客/主观题)
export const systemScoreManageAdjustmentScore = (query) => {
    return request({
        url: '/system/score/manage/adjustmentScore',
        method: 'post',
        data: query
    })
}

// 考试学生成绩录入
export const systemScoreManageAdditionScore = (query) => {
    return request({
        url: '/system/score/manage/additionScore',
        method: 'post',
        data: query
    })
}

export const systemScoreManageExport = (query) => {
    return request({
        url: '/system/score/manage/export',
        method: 'post',
        data: query
    })
}

// 成绩导出状态查询
export const systemScoreManageExportStatus = (query) => {
    return request({
        url: '/system/score/manage/exportStatus',
        method: 'post',
        data: query
    })
}

/**
 * 上线信息
*/
// 上线信息-列表
export const launchInfoList = (query) => {
    return request({
        url: '/system/online/admin/exam/list',
        method: 'get',
        params: query
    })
}
// 上线信息-编辑
export const launchInfoEdit = (query) => {
    return request({
        url: 'system/online/admin/updateSysExam',
        method: 'post',
        data: query
    })
}
// 客观题重新比对（仅单选）
export const systemScoreManageCxsc = (query) => {
    return request({
        url: '/task/objective/score/recheck',
        method: 'get',
        params: query
    })
}
// 获取考试列表
export const getExamList = (query) => {
    return request({
        url: '/system/examMain/list',
        method: 'get',
        params: query
    })
}
// 批量开始生成PDF
export const startGeneratePdfBatch = (query) => {
    return request({
        url: '/proxy/generateBatchPdf',
        method: 'post',
        params: query
    })
}

// 步骤
export const getStepList = (taskId) => {
    return request({
        url: `/generate/serializeProcesses/tasks/${taskId}/steps`,
        method: 'get',
        params: {}
    })
}
// 下载任务ZIP包
export const downloadTaskZip = (taskId) => {
    return request({
        url: `/generate/serializeProcesses/download/task/${taskId}/zip`,
        method: 'get',
        params: {},
        responseType: 'blob'
    })
}
// 学校及学科进度
export const serializeProcesses = (taskId) => {
    return request({
        url: `/generate/serializeProcesses/progress/${taskId}`,
        method: 'get',
        params: {}
    })
}
// 生成联考总览PDF
export const getExamPdfReport = (params) => {
    return request({
        url: `/generate/serializeProcesses/pdf/jointExamOverview`,
        method: 'post',
        params: params,
    })
}
// 生成单校报告PDF
export const getSchoolPdfReport = (params) => {
    return request({
        url: `/generate/serializeProcesses/pdf/schoolReport`,
        method: 'post',
        params: params,
    })
}
// 生成联考单学科PDF
export const getSubjectPdfReport = (params) => {
    return request({
        url: `/generate/serializeProcesses/pdf/jointExamSubject`,
        method: 'post',
        params: params,
    })
}

// 获取考试任务列表
export const getExamTasks = (examId) => {
    return request({
        url: `/generate/serializeProcesses/tasks/${examId}`,
        method: 'get',
        params: {}
    })
}

// 获取任务进度
export const getTaskProgress = (taskId) => {
    return request({
        url: `/generate/serializeProcesses/progress/${taskId}`,
        method: 'get',
        params: {}
    })
}

// 获取任务文件列表
export const getTaskFiles = (taskId) => {
    return request({
        url: `/generate/serializeProcesses/download/task/${taskId}/files`,
        method: 'get',
        params: {}
    })
}

// 获取考试统计信息
export const getExamDownloadStats = (examId) => {
    return request({
        url: `/generate/serializeProcesses/download/exam/${examId}/stats`,
        method: 'get',
        params: {}
    })
}

// 卷面留痕-列表
export const getRecordList = (query) => {
    return request({
        url: '/analysis/record/list',
        method: 'get',
        params: query
    })
}


// 总分列表
export const getTotalScoreList = (query) => {
    return request({
        url: '/system/score/manage/totalScore/list',
        method: 'get',
        params: query
    })
}

// 删除留痕记录
export const deleteRecord = (ids) => {
    return request({
        url: `/analysis/record/${ids}`,
        method: 'delete',
    })
}
// 成绩管理-总分-详情
export const getStudentTotalScoreInfo = (query) => {
    return request({
        url: '/analysis/score/getStudentTotalScoreInfo',
        method: 'get',
        params: query
    })
}
// 导入总成绩
export function importTotalScore(data,deptId,examId,examSchoolId){
    return request({
        url:`/system/score/manage/all/score/import?deptId=${deptId}&examId=${examId}&examSchoolId=${examSchoolId}`,
        method:'post',
        data:data,
        responseType: 'blob',
        headers: {
            'Content-Type': 'multipart/form-data' 
        }
    })
}
// 计算赋分
export function calculateEndowScore(data){
    return request({
        url:`/task/endow/calculate`,
        method:'put',
        data:data,
    })
}
// 成绩分析列表
export function getScoreAnalysisList(data){
    return request({
        url:`/analysis/result/list`,
        method:'get',
        params:data,
    })
}
// 生成成绩分析
export function generateScoreAnalysis(data){
    return request({
        url:`/proxy/generationExcel?examId=${data.examId}&regen=${data.regen}`,
        method:'post',
        data:data,
    })
}
// 计算
export function generateCalculateAll(data){
    return request({
        url:`/proxy/forwardCalculateAll?examId=${data.examId}`,
        method:'post',
        data:data,
    })
}
// 计算状态
export function getCalculateStatus(data){
    return request({
        url:`/analysis/total/score/getCalculateStatus?examId=${data.examId}`,
        method:'get',
        data:data,
    })
}
// 获取生成百分比
export function getGenerationProgress(examId){
    return request({
        url:`/analysis/report/excel/examScoreAnalysisLoad?examId=${examId}`,
        method:'get',
    })
}
// 生成有痕阅卷
export function generateMarkingReport(data){
    return request({
        url:`/analysis/record/generate`,
        method:'post',
        params:data,
    })
}

// 计算成绩分段统计
export function calculateScoreStatistics(data){
    return request({
        url:`/analysis/total/score/calTotalScoreSegment`,
        method:'get',
        params:data,
    })
}
// 计算总分
export function calculateTotalScore(data){
    return request({
        url:`/analysis/score/calculateExamTotalScore`,
        method:'post',
        params:data,
    })
}
// 题目分析
export function questionAnalysis(data){
    return request({
        url:`/analysis/question/questionStats`,
        method:'post',
        params:data,
    })
}

// 下载总成绩
export function downloadAllScore(data){
    return request({
        url:`/system/score/manage/export/total`,
        method:'post',
        params:data,
        responseType: 'blob',
        // headers: {
        //     'Content-Type': 'application/json;charset=UTF-8' 
        // }
           headers: {
            'Content-Type': 'multipart/form-data' 
        }
    })
}
